package com.service.manage.imp;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.mapper.manage.RoleDao;
import com.po.Permission;
import com.po.Role;
import com.service.manage.RoleService;

@Service
public class RoleServiceImp implements RoleService {

	@Resource(name="roleDao")
	public RoleDao roleDao;
	
	@Override
	public List<Role> getRoleListN() {
		List<Role> list = roleDao.getRoleListN();
		return list;
	}

	@Override
	public String getRoleID(String role_name) {
		String i=roleDao.getRoleID(role_name);
		return i;
	}
	
	
	
	@Override
	public List<Role> getRole(Role role) {
		
		List<Role> list  = roleDao.getRoleList(role);
		return list;
	}

	@Override
	public int addRole(Role role) {
		
		int result = roleDao.addRole(role);
		return result;
	}

	@Override
	public int delRole(Role role) {
		
		int result = roleDao.delRole(role);
		return result;
	}

	@Override
	public int updateRole(Role role) {
		
		int result = roleDao.updateRole(role);
		return result;
	}

	@Override
	public int delRoles(String[] roleids) {

		int result = roleDao.delRoleList(roleids);
		return result;
	}

	
	@Override
	public int getRoleCount(Role role) {
		
		int result = roleDao.getRoleCount(role);
		return result;
	}

	@Override
	public List<Role> getRolePermission(Role role) {
		
		List<Role> list = roleDao.getRolePermission(role);
		return list;
	}
	
	@Override
	public int addRolePermission(List<Role> role) {
		
		int result = roleDao.addRolePermission(role);
		return result;
	}

	@Override
	public int delRolePermission(Role role) {
		
		int result = roleDao.delRolePermission(role);
		return result;
	}

	@Override
	public List<Permission> getPermissionList() {
		
		List<Permission> list = roleDao.getPermissionList();
		return list;
	}

	@Override
	public List<Role> getRolePermissionList(Role role) {
		
		List<Role> list = roleDao.getRolePermissionArray(role);
		return list;
	}

	
	

}
